function Search(list, attrs, search) {
    let results = [];
    let type = (typeof attrs);
    for (let i = 0; i < list.length; i++) {
        let obj = list[i];
        if (!search) {
            results.push(obj);
            continue;
        }
        if (type === 'array') {
            for (let j = 0; j < attrs.length; j++) {
                let attr = attrs[j];
                if (obj[attr].indexOf(search) >= 0) {
                    results.push(obj);
                    break;
                }
            }
        } else if (type === 'string') {
            if (obj[attrs].indexOf(search) >= 0) {
                results.push(obj);
            }
        }
    }
    return results;
}

export default {Search}